﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;

namespace VLog
{
    /// <summary>
    /// txt 日志
    /// </summary>
    internal class TxtVLog : VLogBase
    {
        public TxtVLog()
        {
            this.Path = LogCommons.GetPath(LogType.TxtVLog);
        }

        protected override void Write(VLogEntity entity)
        {
            string text = string.Format(@"
                    Content:    {0}
                    Date:       {1}
                    Level:      {2}"
                  , entity.FullInfo
                  , DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffff")
                  , entity.Level
                  );

            File.AppendAllText(this.Path, text, Encoding.UTF8);
        }
    }
}
